package com.gitee.feizns.quickstart.web.decrypt;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.springframework.web.bind.annotation.RequestBody;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自动解密.
 * <p>
 *  可以将该注解放置在控制器方法简单参数上相应的处理器是{@link DecryptParameterResolver}<br/>
 *  可以将该注解放置在控制器方法实体参数上相应的处理器是{@link DecryptServletModelAttributeMethodProcessor}<br/>
 *  可以将该注解放在标注了{@link RequestBody}的实体参数上、相应的处理器为{@link DecryptStdDeserializer}<br/>
 * </p>
 * @see DecryptParameterResolver
 * @see DecryptServletModelAttributeMethodProcessor
 * @see DecryptStdDeserializer
 * @author feiznsSS
 * @since 2019/7/20
 */
@Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonDeserialize(using = DecryptStdDeserializer.class)
public @interface Decrypt {
}
